public class MailThread1 extends Thread {

	private String name;
	private Mailbox2 mb;

	public MailThread1(String name, Mailbox2 mail) {
		this.name = name;
		mb = mail;
	}

	public void run() {
		for (int i = 0; i < 5; i++) {
			mb.setMessage(name);
			try {
				Thread.sleep((long) (200 * Math.random()));
			} catch (Exception e) {
			}
		}
	}

}